package com.alibaba.aone.casestudy.module.screen;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.aone.casestudy.common.entity.Failure;
import com.alibaba.aone.casestudy.common.entity.FailureRpAsignGroup;
import com.alibaba.aone.casestudy.common.entity.FailureTime;
import com.alibaba.aone.casestudy.common.utils.MetaUtil;


import com.alibaba.aone.casestudy.service.FailureService;
import com.alibaba.aone.casestudy.service.FailureTimeService;
import com.alibaba.aone.casestudy.service.GroupService;
import com.alibaba.aone.casestudy.service.MetaService;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;

/**
 * 类FailureDetailView.java的实现描述：TODO 类实现描述
 * 
 * @author yongchun.chengyc 2011-4-26 下午08:46:16
 */
public class FailureDetailView {

	@Autowired
	private FailureService failureService;
	@Autowired
	private GroupService groupService;
	@Autowired
	private FailureTimeService failtureTimeService;
	@Autowired
	private MetaService metaService;

	public void execute(@Param("number")
	String number, Context context) {

		Failure failure = failureService.getFailureByNumber(number);
	//	FailureRpAsignGroup group = groupService.getGroup(number);
		List<FailureRpAsignGroup> groups = groupService.getGroups(number);
		List<FailureTime> timeList = (List<FailureTime>) failtureTimeService
				.getFailureTime(number);
		String value = null;

		

		context.put("failure", failure);
		context.put("groups", groups);
		context.put("timeList", timeList);

		MetaUtil util = new MetaUtil();
		context.put("metaService", metaService);
		context.put("util", util);
	}

}
